package follow.pratice.in2020.November.javaguide.basis.demo1;

public class Test {
    public static void main(String[] args) {
        Student s1 = new Student("小李");
        Student s2 = new Student("小张");

        swap(s1, s2);
        System.out.println("s1:" + s1.getName());
        System.out.println("s2:" + s2.getName());

    }

    public static void swap(Student x, Student y) {
        Student temp = x;
        x = y;

        y = temp;
        System.out.println("x:" + x.getName());
        System.out.println("y:" + y.getName());


    }
}
